﻿<?xml version="1.0" encoding="utf-8" ?>

<cls:class
	name="DictionaryIterator"
	type="http://metalx.org/DictionaryIterator"
	xmlns="http://metalx.org/Program"
	xmlns:dbg="http://metalx.org/i386/Functions/Debug"
	xmlns:col="http://metalx.org/i386/Functions/Collection"
	xmlns:lst="http://metalx.org/i386/Functions/List"
	xmlns:con="http://metalx.org/i386/Functions/Console"
	xmlns:int="http://metalx.org/i386/Functions/Integer"
	xmlns:str="http://metalx.org/i386/Functions/String"
	xmlns:clsf="http://metalx.org/i386/Functions/Class"
	xmlns:var="http://metalx.org/Variable"
	xmlns:sys="http://metalx.org/i386/Functions/System"
	xmlns:cat="http://metalx.org/i386/Functions/Catalog"
	xmlns:obj="http://metalx.org/i386/Functions/Object"
	xmlns:asc="http://metalx.org/Ansi/Ascii"
	xmlns:logic="http://metalx.org/Intel/80386/Logic"
	xmlns:math="http://metalx.org/Intel/80386/Math"
	xmlns:imm="http://metalx.org/Intel/80386/Immediate"
	xmlns:inc="http://metalx.org/Intel/80386/Increment"
	xmlns:cpu="http://metalx.org/Intel/80386/Operators"
	xmlns:op="http://metalx.org/Intel/80386/Operands"
	xmlns:cls="http://metalx.org/Class">

	<cls:field name="Index" offset="4" type="http://metalx.org/Integer"/>

	<cls:method name="GetItem" type="http://metalx.org/Object">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>
		
		<obj:GetData/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddressPlusImmediate8/>
		<byte>4</byte>

		<cpu:CopyOperandToRegister/>
		<op:SI-SIAddress/>

		<obj:GetData/>

		<col:GetItem/>

		<cpu:CopyRegisterToOperand/>
		<op:SI-DIRegister/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="Next" type="http://metalx.org/DictionaryIterator">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<cpu:IncrementFunction/>
		<inc:IncrementSIAddressPlusImmediate8/>
		<byte>4</byte>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="Skip" type="http://metalx.org/DictionaryIterator">
		<cpu:ExchangeOperandWithRegister/>
		<op:BP-SPRegister/>

		<cpu:PullSIFromStack/>

		<cpu:ExchangeOperandWithRegister/>
		<op:BP-SPRegister/>

		<obj:GetData/>

		<cpu:CopySIAddressToAXAndIncrementSI/>

		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<cpu:AddRegisterToOperand/>
		<op:AX-SIAddressPlusImmediate8/>
		<byte>4</byte>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="ToString" type="http://metalx.org/String">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddressPlusImmediate8/>
		<byte>4</byte>

		<cpu:CopyOperandToRegister/>
		<op:SI-SIAddress/>

		<obj:GetData/>

		<col:GetItem/>

		<cpu:PushSIToStack/>

		<obj:GetType/>

		<cpu:CopyImmediateToDI/>
		<addressOf ref="methodName" type="Absolute32"/>

		<clsf:FindMethod/>

		<clsf:GetMethodEntryPoint/>

		<cpu:PullDIFromStack/>

		<cpu:LogicFunction/>
		<logic:CallSIRegister/>

		<cpu:ReturnToNearCaller/>

		<label id="methodName"/>
		<int>8</int>
		<string>ToString</string>
	</cls:method>

	<cls:method name="GetClass" type="http://metalx.org/Class">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetType/>

		<cpu:CopyRegisterToOperand/>
		<op:SI-DIRegister/>

		<clsf:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetClass" type="http://metalx.org/Class" static="true">
		<cpu:CopyRegisterToOperand/>
		<op:BX-DIRegister/>

		<clsf:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>
</cls:class>